<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();

//会员信息
$time=date("Y-m-d");
$time2=date("Y-m-d",strtotime("-1 day"));
$time3=date("Y-m");
//会员总数
$totalhy=pdo_get('snx_users', array('uniacid'=>$_W['uniacid']), array('count(id) as count'));
//今日新增会员
$sql = pdo_fetchcolumn("select count(id) from" . tablename('snx_users') ." where uniacid={$_W['uniacid']} and create_time like '%{$time}%'");
//昨日新增
$zuor = pdo_fetchcolumn("select count(id) from" . tablename('snx_users') ." where uniacid={$_W['uniacid']} and create_time like '%{$time2}%'");
//本月新增
$beny = pdo_fetchcolumn("select count(id) from" . tablename('snx_users') ." where uniacid={$_W['uniacid']} and create_time like '%{$time3}%'");
//print_r(json_encode($beny));die;
//悬赏一览
//悬赏总数
$goodstotal=pdo_get('wxc_order', array('uniacid'=>$_W['uniacid']), array('count(id) as count'));
//print_r(json_encode($goodstotal));die;
//今日悬赏新增
$sq2 = pdo_fetchcolumn("select count(id) from" . tablename('wxc_order') ." where uniacid={$_W['uniacid']} and created_time like '%{$time}%'");
//print_r(json_encode($sql));die;
//今日凭证新增
$sq3 = pdo_fetchcolumn("select count(id) from" . tablename('wxc_task') ." where uniacid={$_W['uniacid']} and create_time like '%{$time}%'");
//凭证总数
$dfhorder=pdo_get('wxc_task', array('uniacid'=>$_W['uniacid']), array('count(id) as count'));
//$sql=" select count(id) as count from".tablename('zh_gjhdbm_bmlist')." where uniacid={$_W['uniacid']} and status=1 and state!=5 and state!=6";
//$dfhorder=pdo_fetch($sql);


//悬赏待审核数量
$tztotal=pdo_get('wxc_order', array('uniacid'=>$_W['uniacid'],'status'=>0), array('count(id) as count'));
//悬赏数量
$shtotal=pdo_get('wxc_order', array('uniacid'=>$_W['uniacid'],'status'=>1), array('count(id) as count'));
//print_r(json_encode($shtotal));die;
//凭证待审核数量
$pctotal=pdo_get('wxc_task', array('uniacid'=>$_W['uniacid'],'status'=>0), array('count(id) as count'));
//凭证数量
$hytotal=pdo_get('wxc_task', array('uniacid'=>$_W['uniacid'],'status'=>1), array('count(id) as count'));
////认证数量
//$zxtotal=pdo_get('zh_gjhdbm_attestation', array('uniacid'=>$_W['uniacid'],'state'=>2), array('count(id) as count'));
////票卷审核数量
//$shpj_num=pdo_get('zh_gjhdbm_bmlist', array('uniacid'=>$_W['uniacid'],'state'=>1,'status'=>1), array('count(id) as count'));
////票卷数量
//$sql22=" select count(*) as count from".tablename('zh_gjhdbm_bmlist')."where uniacid={$_W['uniacid']} and state in (2,3,4) and status=1";
//$pj_num=pdo_fetch($sql22);
////$pj_num=pdo_get('zh_gjhdbm_bmlist', array('uniacid'=>$_W['uniacid'],'state'=>2,'state'=>3,'state'=>4), array('count(id) as count'));

//数据概况

//今日悬赏票款
$sq4 = "select sum(total) as ordermoney from" . tablename('wxc_order') ." where uniacid={$_W['uniacid']} and created_time like '%{$time}%'";
$ordermoney=pdo_fetch($sq4);
$ordermoney['ordermoney']=empty($ordermoney['ordermoney'])?0:$ordermoney['ordermoney'];
//今日新增悬赏
$sq5 = pdo_fetchcolumn("select count(id) from" . tablename('wxc_order') ." where uniacid={$_W['uniacid']} and created_time like '%{$time}%'");

//今日新增悬赏审核
$sq6 = pdo_fetchcolumn("select count(id) from" . tablename('wxc_task') ." where uniacid={$_W['uniacid']} and create_time like '%{$time}%'");

//$sql9=" select  count(id) as count from (select  id,FROM_UNIXTIME(time) as time  from".tablename('wxc_task')." where uniacid={$_W['uniacid']} ) a  where time like '%{$time}%' ";
//$jrzzzbf=pdo_fetch($sql9);
////今日新增票卷
//$sql10=" select count(id) as count from (select  id,FROM_UNIXTIME(time) as time  from".tablename('zh_gjhdbm_bmlist')." where uniacid={$_W['uniacid']} and status=1) a where time like '%{$time}%' ";
//$jrxzpj=pdo_fetch($sql10);


include $this->template('web/gaikuangdata');